<a name="product-<?php echo $data->id; ?>"></a>

<div class="product-view<?php echo (int)$data->getRemainingQuantity()===0 ? ' reserved':''; ?> float-container">

	<div class="left-column float-left text-center">
		<a href="<?php echo Yii::app()->createUrl('//item/view',array('id'=>$data->id)); ?>">
			<?php $data->product->renderImage(IMAGE_VERSION_SMALL); ?>
		</a>
	</div>

	<div class="right-column float-left float-container">

		<h2 class="name"><?php echo CHtml::link($data->product->name,array('//item/view','id'=>$data->id)); ?></h2>

		<p class="details"><?php echo str_replace(PHP_EOL,'<br />',$data->product->details); ?></p>

		<hr />

		<div class="float-left">

			<p class="price">
				<strong><?php echo CHtml::encode($data->product->getAttributeLabel('price')); ?></strong>:
				<?php echo Yii::app()->numberFormatter->formatCurrency($data->product->price,'EUR'); ?>
			</p>

			<p class="reserved">
				<strong><?php echo Yii::t('app','Reserved'); ?></strong>:
				<?php echo CHtml::encode($data->reservedCount); ?> / <?php echo CHtml::encode($data->quantity); ?>
			</p>

		</div>

		<div class="quick-reservation float-right">

			<?php if($data->getRemainingQuantity()>0): ?>

				<?php if($data->getRemainingQuantity()>1): ?>

					<?php $this->renderPartial('_reservationForm',array(
						'model'=>$models[$data->id],
						'data'=>$data,
					)); ?>

				<?php else: ?>

					<?php $this->widget('zii.widgets.jui.CJuiButton', array(
						'name'=>'create-reservation-button-'.$data->id,
						'buttonType'=>'link',
						'caption'=>Yii::t('app','Create Reservation'),
						'url'=>Yii::app()->createUrl('//reservation/create',array('itemId'=>$data->id,'quantity'=>1)),
					)); ?>

				<?php endif; ?>

			<?php endif; ?>

		</div>

	</div>

</div>